import fly from "../utils/request.js";
export const allChannels = () => {
    return fly.get({
        url:"/user/channels"
    })
}
export const getArticles = (data) => {
    return fly.get('/articles',data)
}
export const articleDetails = (id) => {
    return fly.get('/articles/'+id)
}
export const getComments = (data) => {
    return fly.get('/comments',data)
}
export const followUsers = (data) => {
    return fly.post('/user/followings',data)
}
export const accessUser = (target) => {
    return fly.delete('/user/followings/' + target) 
}
export const collectArticles = (data) => {
    return fly.post('/article/collections' ,data) 
}
export const cancelCollection = (target) => {
    return fly.delete('/article/collections/'+target) 
}
// 对文章点赞
export const likeSuccessfully = (data) => {
    return fly.post('/article/likings',data) 
}
// 取消对文章点赞
export const cancelLike = (target) => {
    return fly.delete(`/article/likings/${target}`) 
}
// 对评论或评论回复点赞
export const commentLike = (data) => {
    return fly.post('/comment/likings',data) 
}
// 取消对评论或评论回复点赞
export const cancelCommentLike = (target) => {
    return fly.delete(`/comment/likings/${target}`) 
}
// 添加评论或评论回复
export const addComment = (data) => {
    return fly.post('/comments',data) 
}